<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>

        // let student = {
        //     name: "张三",
        //     age: 20
        // }

        // console.log(Object.keys(student));

        // console.log(student == {});

        // for (let key in student) {
        //     console.log(student[key]);
        // }

        // 构造函数
        // let obj2 = new Object();


        // let name = "张三";
        // let age = 20;

        let student = {
            // name: name,
            // age: age,
            name,
            age,
            sayHello() {
                console.log("你好");
            }
        }

        // student.sayHello();





        // 字面量
        // let obj1 = {
        //     age: 20,
        //     gender: "男",
        //     name: "张三",
        //     phone: "1351111111",
        //     parentPhone: '123245666',
        // };

        // let key = "phone";

        // // console.log(obj1.key);
        // console.log(obj1[key]);


        // console.log(obj1.name);
        // console.log(obj1["age"]);

        // obj1.parent = "王五";
        // obj1.age = 18;

        // obj1["gender"] = "女";


        // delete obj1.parentPhone;
        // delete obj1["phone"]

        // console.log(obj1);



    </script>
</body>

</html>